<template>
  <div class="app-container table-app-container">
    <div class="fixed-table">
      <TableFilter :temp-query="tempQuery" />
      <PageableTable
        :loading="loading"
        :data="insideTableData"
        :total="totalElements"
        :page="currentPage"
        :page-size="pageSize"
        :table-height="tableHeight"
        :multiple-selected="false"
        :disable-pageable="false"
        class="fixed-table-table"
        @page-change="onPageChange"
        @sort-change="onSortChange"
      >
        <el-table-column v-for="column in insideColumns" :key="column.key" :width="column.width" :label="column.title" :prop="column.key" :sortable="column.sortable">
          <template slot-scope="scope">
            <column-render :render="column.render" :row="scope.row" :column="column" />
          </template>
        </el-table-column>
      </PageableTable>
    </div>
  </div>
</template>

<script>
// 表格查询组件独立编写，需要传递pageable-table实例的mixin方法filter
import TableFilter from './components/tableFilter'
// 编辑实例组件独立编写，需要传递id属性，判断新建还是更新操作
// import ActionBar from './components/actionBar'
import PageableTable from '@neu/biz-core/components/PageableTable'
import databind from '@neu/biz-core/mixins/databind'
import { report } from '@neu/dcom-ui/api/hnInspectionTaskHealth'

export default {
  name: 'HealthInspectionReportPage',
  components: {
    TableFilter,
    // ActionBar,
    PageableTable
  },
  // 加入混入，使表格混入更多的api操作
  mixins: [databind],
  data() {
    return {
      r: report,
      insideColumns: [
        { title: '巡检日期', key: 'start_date_time' },
        { title: '服务厅局', key: 'institution_name' },
        { title: '巡检人', key: 'user_name' },
        { title: '巡检状态', key: 'status_name' },
        { title: '完成时间', key: 'actual_date_time' },
        { title: '巡检结果', key: 'result_text' }
      ],
      tempQuery: {}
    }
  },
  mounted() {
    this.tempQuery = this.$route.params
  }
}
</script>
